/**
 * Created by lx on 2017/6/22.
 */
var mongoose = require('./models');//连接数据库
    //3.创建骨架(模型) ：  indexs数据表的结构
var indexsSchema = new mongoose.Schema({
    id:Number,
    content:String,
    price:Number,
    saled:Number,
    imgSrc:String,
    slideimgSrc:Array,
    originalPrice:Number,
    postage:Number,
    detailimgSrc:Array
});
    //4.创建模型(Model)
var indexsModel = mongoose.model('index', indexsSchema, 'indexs');

//
//    //5.组装indexs表需要添加的数据
//var index = [{
//    id:1,
//    content:"悠漫（Lancaster）原味香纯奶焙糖 400g 高级礼盒装",
//    price:99.00,
//    saled:0,
//    imgSrc:"http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/HkGSQ1435755497.jpg",
//    slideimgSrc:[["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/HkGSQ1435755497.jpg"],
//        ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/mioYJ1435755499.jpg"],
//        ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/KRN2W1435755502.jpg"],
//        ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/iuzS31435755504.jpg"]],
//    originalPrice:119.00,
//    postage:15.00,
//    detailimgSrc:[["http://img20.360buyimg.com/vc/jfs/t529/77/768858564/48537/40d94aa1/54868dfcNfb7f7b25.jpg"],
//        ["http://img20.360buyimg.com/vc/jfs/t556/297/751383365/64664/1d665e05/54852aecN6f6aa620.jpg"],
//        ["http://img20.360buyimg.com/vc/jfs/t691/160/728490141/36186/5f0047c7/54852b3aN5fd8ffff.jpg"],
//        ["http://img20.360buyimg.com/vc/jfs/t739/217/83047254/165931/32f27430/54852b66Nf5c41af6.jpg"]]
//},{
//    id:2,
//    content:"悠漫（Lancasten）进口奶源奶焙糖 原味香纯奶焙糖袋装500g",
//    price:39.00,
//    saled:0,
//    imgSrc:"http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/Su5l31435755169.jpg",
//    slideimgSrc:[["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/Su5l31435755169.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/Wet021435755172.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/SkC7T1435755174.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/r2Ero1435755177.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/9WRLy1435755179.jpg"]],
//    originalPrice:49.00,
//    postage:15.00,
//    detailimgSrc:[["http://img30.360buyimg.com/popWaterMark/jfs/t1270/88/666807958/90616/5bf0f609/5539fb6bN49b8ffde.jpg"],
//    ["http://img30.360buyimg.com/popWaterMark/jfs/t760/35/1398092349/189205/67d8bace/5539fb6bNd48552cc.jpg"],
//    ["http://img30.360buyimg.com/popWaterMark/jfs/t760/30/1440184662/258767/5f6fc4fc/5539fb6cN0160a7bc.jpg"]]
//},{
//    id:3,
//    content:"悠漫（Lancasten）原味香纯奶焙糖 228g",
//    price:29.00,
//    saled:0,
//    imgSrc:"http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/9wlGs1435754908.jpg",
//    slideimgSrc:[["http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/9wlGs1435754908.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/epQzl1435754910.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/3iMJN1435754913.jpg"]],
//    originalPrice:50.00,
//    postage:15.00,
//    detailimgSrc:[["http://img20.360buyimg.com/vc/jfs/t352/364/441117215/48537/40d94aa1/54115986Nc4dfe941.jpg"],
//    ["http://img20.360buyimg.com/vc/jfs/t304/115/423788603/36768/9c09ad87/54115ac8N3dd620a1.jpg"],
//    ["http://img20.360buyimg.com/vc/jfs/t328/344/415888996/108255/7f383b36/54102711N46a91b8f.jpg"]]
//},{
//    id:4,
//    content:"悠漫（Lancaster）原味香纯奶焙糖 400g 高级礼盒装",
//    price:99.00,
//    saled:0,
//    imgSrc:"http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/HkGSQ1435755497.jpg",
//    slideimgSrc:[["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/HkGSQ1435755497.jpg"],
//        ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/mioYJ1435755499.jpg"],
//        ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/KRN2W1435755502.jpg"],
//        ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/iuzS31435755504.jpg"]],
//    originalPrice:119.00,
//    postage:15.00,
//    detailimgSrc:[["http://img20.360buyimg.com/vc/jfs/t529/77/768858564/48537/40d94aa1/54868dfcNfb7f7b25.jpg"],
//        ["http://img20.360buyimg.com/vc/jfs/t556/297/751383365/64664/1d665e05/54852aecN6f6aa620.jpg"],
//        ["http://img20.360buyimg.com/vc/jfs/t691/160/728490141/36186/5f0047c7/54852b3aN5fd8ffff.jpg"],
//        ["http://img20.360buyimg.com/vc/jfs/t739/217/83047254/165931/32f27430/54852b66Nf5c41af6.jpg"]]
//},{
//    id:5,
//    content:"悠漫（Lancasten）进口奶源奶焙糖 原味香纯奶焙糖袋装500g",
//    price:39.00,
//    saled:0,
//    imgSrc:"http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/Su5l31435755169.jpg",
//    slideimgSrc:[["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/Su5l31435755169.jpg"],
//        ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/Wet021435755172.jpg"],
//        ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/SkC7T1435755174.jpg"],
//        ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/r2Ero1435755177.jpg"],
//        ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/9WRLy1435755179.jpg"]],
//    originalPrice:49.00,
//    postage:15.00,
//    detailimgSrc:[["http://img30.360buyimg.com/popWaterMark/jfs/t1270/88/666807958/90616/5bf0f609/5539fb6bN49b8ffde.jpg"],
//        ["http://img30.360buyimg.com/popWaterMark/jfs/t760/35/1398092349/189205/67d8bace/5539fb6bNd48552cc.jpg"],
//        ["http://img30.360buyimg.com/popWaterMark/jfs/t760/30/1440184662/258767/5f6fc4fc/5539fb6cN0160a7bc.jpg"]]
//},{
//    id:6,
//    content:"悠漫（Lancasten）原味香纯奶焙糖 228g",
//    price:29.00,
//    saled:0,
//    imgSrc:"http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/9wlGs1435754908.jpg",
//    slideimgSrc:[["http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/9wlGs1435754908.jpg"],
//        ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/epQzl1435754910.jpg"],
//        ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/3iMJN1435754913.jpg"]],
//    originalPrice:50.00,
//    postage:15.00,
//    detailimgSrc:[["http://img20.360buyimg.com/vc/jfs/t352/364/441117215/48537/40d94aa1/54115986Nc4dfe941.jpg"],
//        ["http://img20.360buyimg.com/vc/jfs/t304/115/423788603/36768/9c09ad87/54115ac8N3dd620a1.jpg"],
//        ["http://img20.360buyimg.com/vc/jfs/t328/344/415888996/108255/7f383b36/54102711N46a91b8f.jpg"]]
//},{
//    id:7,
//    content:"口福莱 意大利进口硬棒棒糖 13.5克 42支整盒装",
//    price:299.00,
//    saled:0,
//    imgSrc:"http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/3Sa211435754397.jpg",
//    slideimgSrc:[["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/3Sa211435754397.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/yIxvL1435754400.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/mTl8J1435754402.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/Z7mTV1435754405.jpg"]],
//    originalPrice:359.00,
//    postage:15.00,
//    detailimgSrc:[["http://img30.360buyimg.com/popWareDetail/jfs/t322/40/640154867/329589/66146344/541d26d6N3d3f00ee.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t274/78/656549139/105318/618c1977/541d26d6Nd81698b1.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t388/245/445689940/277910/6ab8bd44/541d26d7N89c524e8.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t322/39/648957480/308440/2be1258c/541d26d7Nd0066893.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t286/274/649029524/248977/a21d0190/541d26d8N74745238.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t322/41/663326442/351809/e689a3a7/541d26daN571d9cb6.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t292/169/649567239/189998/ee7e9dd/541d26dbNc9006556.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t439/256/438858419/78944/ff9a9aa5/541d26dcN81657afb.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t364/42/440166070/129170/106194e7/541d26dcN87d0e8fc.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t361/233/430179398/218425/a1ced2f7/541d26ddN183a0fe2.jpg"]]
//}];
//    //6.执行添加indexs表数据的操作
//indexsModel.create(index, function (err) {
//    if(err)
//        throw err;
//    console.log('indexs表添加数据成功！');
//});

//3.创建骨架(模型) ：  senyongs数据表的结构
var senyongsSchema = new mongoose.Schema({
    id:Number,
    content:String,
    price:Number,
    saled:Number,
    imgSrc:String,
    slideimgSrc:Array,
    originalPrice:Number,
    postage:Number,
    detailimgSrc:Array
});
//4.创建模型(Model)
var senyongsModel = mongoose.model('senyong', senyongsSchema, 'senyongs');

////5.组装senyongs表需要添加的数据
//var senyong = [{
//    id:1,
//    content:"森永 嗨啾果汁 软糖1000g",
//    price:69.00,
//    saled:0,
//    imgSrc:"http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/0dCHk1435752304.jpg",
//    slideimgSrc:[["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/0dCHk1435752304.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/mWzoK1435752307.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/0JaRz1435752310.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/vzrcr1435752313.jpg"]],
//    originalPrice:89.00,
//    postage:15.00,
//    detailimgSrc:[["http://img30.360buyimg.com/popWareDetail/jfs/t709/220/677152572/207415/b0bbfca2/54d1d8b6Ncef3193d.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t559/347/1357131673/422924/6102f47e/54d1d8b7N293c7e73.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t769/323/718140018/184795/da86cabe/54d1d8b7N6b60132e.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t625/339/1389813042/132359/34cf4b4e/54d1d8b7N260fbaf2.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t589/214/1363831483/132163/9bc0b3a2/54d1d8b8N7cbabe84.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t700/35/710403443/165773/65b79b56/54d1d8b8N65a86ac3.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t646/36/1385603830/246545/a11e1cd/54d1d8b8N2fd0bb57.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t463/116/1394728639/380471/dc8de37e/54d1d8b9N9635c43e.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t460/197/1383204330/349706/ae72db1e/54d1d8b9Nb42faf02.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t463/116/1394728639/380471/dc8de37e/54d1d8b9N9635c43e.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t709/226/681162461/196801/94a2ec99/54d1d8b9N960d2d5e.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t733/274/704129385/335745/74fac0a4/54d1d8baNff594e6d.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t571/242/1357472792/283818/a5e643b/54d1d8baN13c7edc2.jpg"]]
//},{
//    id:2,
//    content:"森永嗨啾HI-CHEW 果汁夹心软糖 57g",
//    price:35.00,
//    saled:0,
//    imgSrc:"http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/hUkRp1435752773.jpg",
//    slideimgSrc:[["http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/hUkRp1435752773.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/hODND1435752776.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/WP4bp1435752778.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/xlhRb1435752781.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/FybEb1435752783.jpg"]],
//    originalPrice:50.00,
//    postage:15.00,
//    detailimgSrc:[["http://img30.360buyimg.com/popWareDetail/jfs/t847/11/545080953/78756/db4e5483/552e0970N491baf79.png"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t931/244/560484849/113129/d85502fa/552e0971Nbd8db5e2.png"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t1024/42/451315930/99703/84c0d886/552e0971N0f06e797.png"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t1216/344/540901429/62742/779b3200/552e0972N8ad85a98.png"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t1087/75/520687274/69640/23c2a08e/552e0972N835857e9.png"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t763/219/1255091234/113191/7c0e53a5/552e0972N985ca4c7.png"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t1210/166/554498803/112817/3811b5b5/552e0972Ndc03d19e.png"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t784/77/535191618/107598/e2656acf/552e0973N1919470e.png"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t1057/294/540801767/93530/a13d9442/552e0973N2508ae83.png"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t931/246/552786796/88344/f1ca3c5d/552e0973Nb51fe55b.png"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t1162/324/538139906/118973/f7812024/552e0974N14b276a8.png"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t976/288/455386509/92977/87ddaaa9/552e0974N9279e26f.png"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t1090/174/535955137/90693/9b83eda5/552e0974N32dd186f.png"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t1117/326/558529746/119318/d779958a/552e0975N30d3bcea.png"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t856/239/555536031/97311/184ee40c/552e0975N4511d2f5.png"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t913/130/561799038/174086/14b506fb/552e0975N6d50a53a.png"]]
//},{
//    id:3,
//    content:"森永 嗨啾hi-chew 果汁软糖礼盒装 糖果礼包",
//    price:69.00,
//    saled:0,
//    imgSrc:"http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/VwSg81435753219.jpg",
//    slideimgSrc:[["http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/VwSg81435753219.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/oZo7w1435753221.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/Okyhg1435753224.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/NHhBc1435753226.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/UlRNt1435753228.jpg"]],
//    originalPrice:89.00,
//    postage:15.00,
//    detailimgSrc:[["http://img30.360buyimg.com/popWareDetail/jfs/t910/14/1122100665/404221/8d021889/557a6be9N45852280.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t1336/220/439907875/332720/c4062b1e/557a6be9N8e1f34b3.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t880/231/1161696032/445979/32492a3a/557a6beaN8c0d6a15.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t1030/251/1168715684/404221/af14d1d9/557a6beaNff7e278c.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t877/303/1148524572/162154/de45d569/557a6bebN306287b1.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t1330/103/455832139/201803/ab8232b5/557a6bebN80cda64c.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t1108/138/1160600362/342408/f58e937a/557a6bebN503e8cee.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t1615/218/371137461/356836/bd7e9572/557a6becNa51bc228.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t1618/132/361026514/291678/81c498c4/557a6becNb91d48e0.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t1453/59/388259323/270491/99f70956/557a6bedNc60b9837.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t1117/74/1153396675/394411/329a927b/557a6bedN0eed213c.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t1444/325/373427060/467423/9d428de7/557a6beeNa0a18b18.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t1663/255/158725649/395390/7296e010/557a6beeNd75c7997.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t1036/148/1118246999/357897/be134e0b/557a6befN5a6275c3.jpg"]]
//}];
//
////6.执行添加senyongs表数据的操作
//senyongsModel.create(senyong, function (err) {
//    if(err)
//        throw err;
//    console.log('senyongs表添加数据成功！');
//});

//3.创建骨架(模型) ：  koufulais数据表的结构
var koufulaisSchema = new mongoose.Schema({
    id:Number,
    content:String,
    price:Number,
    saled:Number,
    imgSrc:String,
    slideimgSrc:Array,
    originalPrice:Number,
    postage:Number,
    detailimgSrc:Array
});
//4.创建模型(Model)
var koufulaisModel = mongoose.model('koufulai', koufulaisSchema, 'koufulais');

////5.组装koufulais表需要添加的数据
//var koufulai = [{
//    id:1,
//    content:"口福莱 意大利进口硬棒棒糖 13.5克 9支装",
//    price:69.00,
//    saled:0,
//    imgSrc:"http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/MsJ471435753779.jpg",
//    slideimgSrc:[["http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/MsJ471435753779.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/FwpJX1435753781.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/4wKnS1435753784.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/g5mWy1435753786.jpg"]],
//    originalPrice:89.00,
//    postage:15.00,
//    detailimgSrc:[["http://img30.360buyimg.com/popWareDetail/jfs/t322/40/640154867/329589/66146344/541d26d6N3d3f00ee.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t274/78/656549139/105318/618c1977/541d26d6Nd81698b1.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t388/245/445689940/277910/6ab8bd44/541d26d7N89c524e8.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t322/39/648957480/308440/2be1258c/541d26d7Nd0066893.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t286/274/649029524/248977/a21d0190/541d26d8N74745238.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t322/41/663326442/351809/e689a3a7/541d26daN571d9cb6.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t292/169/649567239/189998/ee7e9dd/541d26dbNc9006556.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t439/256/438858419/78944/ff9a9aa5/541d26dcN81657afb.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t364/42/440166070/129170/106194e7/541d26dcN87d0e8fc.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t361/233/430179398/218425/a1ced2f7/541d26ddN183a0fe2.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t1150/150/474711224/114216/a1b36d7a/5526472dN601a5776.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t784/65/443300577/529267/c82b7467/55239896N9be3e322.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t697/52/1215899185/226685/a5110d4d/55239897Ne1f083d0.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t736/72/1175813865/194604/1369e341/55239897N042c5a23.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t841/83/434655874/264052/bf90e4eb/55239899Ne92e5f4a.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t973/303/447053364/126994/47b311e8/5523989aN92aa2f31.jpg"]]
//},{
//    id:2,
//    content:"口福莱 意大利进口硬棒棒糖 13.5克 20支装",
//    price:149.00,
//    saled:0,
//    imgSrc:"http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/xh6111435754139.jpg",
//    slideimgSrc:[["http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/xh6111435754139.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/XTGSy1435754141.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/NlNvh1435754144.jpg"]],
//    originalPrice:199.00,
//    postage:15.00,
//    detailimgSrc:[["http://img30.360buyimg.com/popWareDetail/jfs/t322/40/640154867/329589/66146344/541d26d6N3d3f00ee.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t274/78/656549139/105318/618c1977/541d26d6Nd81698b1.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t388/245/445689940/277910/6ab8bd44/541d26d7N89c524e8.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t322/39/648957480/308440/2be1258c/541d26d7Nd0066893.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t286/274/649029524/248977/a21d0190/541d26d8N74745238.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t322/41/663326442/351809/e689a3a7/541d26daN571d9cb6.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t292/169/649567239/189998/ee7e9dd/541d26dbNc9006556.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t439/256/438858419/78944/ff9a9aa5/541d26dcN81657afb.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t364/42/440166070/129170/106194e7/541d26dcN87d0e8fc.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t361/233/430179398/218425/a1ced2f7/541d26ddN183a0fe2.jpg"]]
//},{
//    id:3,
//    content:"口福莱 意大利进口硬棒棒糖 13.5克 42支整盒装",
//    price:299.00,
//    saled:0,
//    imgSrc:"http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/3Sa211435754397.jpg",
//    slideimgSrc:[["http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/3Sa211435754397.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/yIxvL1435754400.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/mTl8J1435754402.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/Z7mTV1435754405.jpg"]],
//    originalPrice:359.00,
//    postage:15.00,
//    detailimgSrc:[["http://img30.360buyimg.com/popWareDetail/jfs/t322/40/640154867/329589/66146344/541d26d6N3d3f00ee.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t274/78/656549139/105318/618c1977/541d26d6Nd81698b1.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t388/245/445689940/277910/6ab8bd44/541d26d7N89c524e8.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t322/39/648957480/308440/2be1258c/541d26d7Nd0066893.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t286/274/649029524/248977/a21d0190/541d26d8N74745238.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t322/41/663326442/351809/e689a3a7/541d26daN571d9cb6.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t292/169/649567239/189998/ee7e9dd/541d26dbNc9006556.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t439/256/438858419/78944/ff9a9aa5/541d26dcN81657afb.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t364/42/440166070/129170/106194e7/541d26dcN87d0e8fc.jpg"],
//    ["http://img30.360buyimg.com/popWareDetail/jfs/t361/233/430179398/218425/a1ced2f7/541d26ddN183a0fe2.jpg"]]
//}];
//
////6.执行添加koufulais表数据的操作
//koufulaisModel.create(koufulai, function (err) {
//    if(err)
//        throw err;
//    console.log('koufulais表添加数据成功！');
//});


//3.创建骨架(模型) ：  youmans数据表的结构
var youmansSchema = new mongoose.Schema({
    id:Number,
    content:String,
    price:Number,
    saled:Number,
    imgSrc:String,
    slideimgSrc:Array,
    originalPrice:Number,
    postage:Number,
    detailimgSrc:Array
});
//4.创建模型(Model)
var youmansModel = mongoose.model('youman', youmansSchema, 'youmans');

////5.组装youmans表需要添加的数据
//var youman = [{
//    id:1,
//    content:"悠漫（Lancasten）原味香纯奶焙糖 228g",
//    price:29.00,
//    saled:0,
//    imgSrc:"http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/9wlGs1435754908.jpg",
//    slideimgSrc:[["http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/9wlGs1435754908.jpg"],
//        ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/epQzl1435754910.jpg"],
//        ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/3iMJN1435754913.jpg"]],
//    originalPrice:50.00,
//    postage:15.00,
//    detailimgSrc:[["http://img20.360buyimg.com/vc/jfs/t352/364/441117215/48537/40d94aa1/54115986Nc4dfe941.jpg"],
//        ["http://img20.360buyimg.com/vc/jfs/t304/115/423788603/36768/9c09ad87/54115ac8N3dd620a1.jpg"],
//        ["http://img20.360buyimg.com/vc/jfs/t328/344/415888996/108255/7f383b36/54102711N46a91b8f.jpg"]]
//},{
//    id:2,
//    content:"悠漫（Lancasten）进口奶源奶焙糖 原味香纯奶焙糖袋装500g",
//    price:39.00,
//    saled:0,
//    imgSrc:"http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/Su5l31435755169.jpg",
//    slideimgSrc:[["http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/Su5l31435755169.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/Wet021435755172.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/SkC7T1435755174.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/r2Ero1435755177.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/9WRLy1435755179.jpg"]],
//    originalPrice:49.00,
//    postage:15.00,
//    detailimgSrc:[["http://img30.360buyimg.com/popWaterMark/jfs/t1270/88/666807958/90616/5bf0f609/5539fb6bN49b8ffde.jpg"],
//        ["http://img30.360buyimg.com/popWaterMark/jfs/t760/35/1398092349/189205/67d8bace/5539fb6bNd48552cc.jpg"],
//        ["http://img30.360buyimg.com/popWaterMark/jfs/t760/30/1440184662/258767/5f6fc4fc/5539fb6cN0160a7bc.jpg"]]
//},{
//    id:3,
//    content:"悠漫（Lancaster）原味香纯奶焙糖 400g 高级礼盒装",
//    price:99.00,
//    saled:0,
//    imgSrc:"http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/HkGSQ1435755497.jpg",
//    slideimgSrc:[["http://img.mcshop.com.cn/c/640x640/uploads/2015-07-01/HkGSQ1435755497.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/mioYJ1435755499.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/KRN2W1435755502.jpg"],
//    ["http://img.mcshop.com.cn/s/640x-/uploads/2015-07-01/iuzS31435755504.jpg"]],
//    originalPrice:119.00,
//    postage:15.00,
//    detailimgSrc:[["http://img20.360buyimg.com/vc/jfs/t529/77/768858564/48537/40d94aa1/54868dfcNfb7f7b25.jpg"],
//        ["http://img20.360buyimg.com/vc/jfs/t556/297/751383365/64664/1d665e05/54852aecN6f6aa620.jpg"],
//        ["http://img20.360buyimg.com/vc/jfs/t691/160/728490141/36186/5f0047c7/54852b3aN5fd8ffff.jpg"],
//        ["http://img20.360buyimg.com/vc/jfs/t739/217/83047254/165931/32f27430/54852b66Nf5c41af6.jpg"]]
//}];
//
////6.执行添加youmans表数据的操作
//youmansModel.create(youman, function (err) {
//    if(err)
//        throw err;
//    console.log('youmans表添加数据成功！');
//});


//3.创建骨架(模型) ：  shoppingcarts数据表的结构
var shoppingcartsSchema = new mongoose.Schema({
    username:String,
        pid:Number,
        content:String,
        price:Number,
        weight:String,
        count:Number,
        imgSrc:String

});
//4.创建模型(Model)
var shoppingcartsModel = mongoose.model('shoppingcart', shoppingcartsSchema, 'shoppingcarts');

//    //5.组装shoppingcarts表需要添加的数据
//var shoppingcart = {
//    username:"测试",
//    pid:999999,
//    content:"测试",
//    price:99999,
//    weight:"测试",
//    count:99999,
//    imgSrc:"测试"
//
//};
//    //6.执行shoppingcarts表添加数据的操作
//shoppingcartsModel.create(shoppingcart, function (err) {
//    if(err)
//        throw err;
//    console.log('shoppingcarts表创建成功！');
//});


//3.创建骨架(模型) ：  users数据表的结构
var usersSchema = new mongoose.Schema({
    username:String,
    password:String
});
//4.创建模型(Model)
var usersModel = mongoose.model('user', usersSchema, 'users');
//    //5.组装users表需要添加的数据
//var user = {
//    username:"123456",
//    password:"123"
//};
//    //6.执行shoppingcarts表添加数据的操作
//usersModel.create(user, function (err) {
//    if(err)
//        throw err;
//    console.log('users表创建成功！');
//});

//获取indexs列表数据
exports.getindexsList = function (callback) {
    indexsModel.find({}, function (err, docs) {
        callback(docs);
    })
};

//获取indexs单条数据
exports.getindexsInfo = function (id,callback) {
    indexsModel.find(id, function (err, indexs) {
        if(err){
            callback(false)
        }else {
            callback(indexs)
        }
    })
};

//获取senyongs列表数据
exports.getsenyongsList = function (callback) {
    senyongsModel.find({}, function (err, docs) {
        callback(docs);
    })
};

//获取senyongs单条数据
exports.getsenyongsInfo = function (id,callback) {
    senyongsModel.find(id, function (err, senyongs) {
        if(err){
            callback(false)
        }else {
            callback(senyongs)
        }
    })
};

//获取koufulais列表数据
exports.getkoufulaisList = function (callback) {
    koufulaisModel.find({}, function (err, docs) {
        callback(docs);
    })
};

//获取koufulais单条数据
exports.getkoufulaisInfo = function (id,callback) {
    koufulaisModel.find(id, function (err, koufulais) {
        if(err){
            callback(false)
        }else {
            callback(koufulais)
        }
    })
};

//获取youmans列表数据
exports.getyoumansList = function (callback) {
    youmansModel.find({}, function (err, docs) {
        callback(docs);
    })
};

//获取youmans单条数据
exports.getyoumansInfo = function (id,callback) {
    youmansModel.find(id, function (err, youmans) {
        if(err){
            callback(false)
        }else {
            callback(youmans)
        }
    })
};

//获取shoppingcarts列表数据


exports.getshoppingcartsList = function (callback) {
    shoppingcartsModel.find({}, function (err, docs) {
        callback(docs);
    })
};

//获取shoppingcarts单条数据
exports.getshoppingcartsInfo = function (id,callback) {
    shoppingcartsModel.find({username:id}, function (err, shoppingcarts) {
        if(err){
            callback(false)
        }else {
            callback(shoppingcarts)
        }
    })
};

//增加shoppingcarts列表数据
exports.addcart = function (data,callback) {
    shoppingcartsModel.create(data, function (err) {
        if(err){
            callback(false)
        }else {
            callback(true)
        }
    })
};

//删除shoppingcarts列表数据
exports.delcart = function (data,callback) {
    shoppingcartsModel.remove({pid:data}, function (err) {
        if(err){
            callback(false)
        }else {
            callback(true)
        }
    })
};

//获取users列表数据
exports.login = function (data,callback) {
    usersModel.findOne(data, function (err, docs) {
        if(err){
            callback(false)
        }else {
            callback(docs)
        }
    })
};

//增加users列表数据
exports.add = function (data,callback) {
    usersModel.create(data, function (err) {
        if(err){
            callback(false)
        }else {
            callback(true)
        }
    })

};